package com.itmayiedu.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;

/**
 * Created by Devin on 2018/1/21.
 */
@Controller
public class IndexController {

    @RequestMapping("/index")
    public String index(ModelMap map){
        map.addAttribute("name","IT硅谷堂");
        map.put("sex",1);
        ArrayList<String> user = new ArrayList<String>();
        user.add("张三");
        user.add("李四");
        user.add("王五");
        map.addAttribute("userList",user);
        return "index1";//跳转到index页面
    }
}
